package com.itheima.service.impl;

import com.itheima.domain.Account;
import com.itheima.mapper.AccountMapper;
import com.itheima.service.AccountService;

import java.util.List;

public class AccountServiceImpl implements AccountService {

    private AccountMapper accountMapper;

    public void setAccountMapper(AccountMapper accountMapper) {
        this.accountMapper = accountMapper;
    }

    @Override
    public void save(Account account) {
        accountMapper.save(account);
    }

    public List findAll(){
        List<Account> all = accountMapper.findAll();
        return all;
    }

    @Override
    public Account findById(Integer id) {
        Account account = accountMapper.findById(id);
        return account;
    }
}
